Left Termination of the query pattern qsort_in_2(g, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

qsort([], []).
qsort(.(H, L), S) :- ','(split(L, H, A, B), ','(qsort(A, A1), ','(qsort(B, B1), append(A1, .(H, B1), S)))).
split([], Y, [], []).
split(.(X, Xs), Y, .(X, Ls), Bs) :- ','(le(X, Y), split(Xs, Y, Ls, Bs)).
split(.(X, Xs), Y, Ls, .(X, Bs)) :- ','(gt(X, Y), split(Xs, Y, Ls, Bs)).
append([], L, L).
append(.(H, L1), L2, .(H, L3)) :- append(L1, L2, L3).
gt(s(X), s(Y)) :- gt(X, Y).
gt(s(X), 0).
le(s(X), s(Y)) :- le(X, Y).
le(0, s(Y)).
le(0, 0).

Queries:

qsort(g,a).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

qsort_in(.(H, L), S) → U1(H, L, S, split_in(L, H, A, B))
split_in(.(X, Xs), Y, Ls, .(X, Bs)) → U7(X, Xs, Y, Ls, Bs, gt_in(X, Y))
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U10(X, Y, gt_in(X, Y))
U10(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U7(X, Xs, Y, Ls, Bs, gt_out(X, Y)) → U8(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
split_in(.(X, Xs), Y, .(X, Ls), Bs) → U5(X, Xs, Y, Ls, Bs, le_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U11(X, Y, le_in(X, Y))
U11(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))
U5(X, Xs, Y, Ls, Bs, le_out(X, Y)) → U6(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
split_in([], Y, [], []) → split_out([], Y, [], [])
U6(X, Xs, Y, Ls, Bs, split_out(Xs, Y, Ls, Bs)) → split_out(.(X, Xs), Y, .(X, Ls), Bs)
U8(X, Xs, Y, Ls, Bs, split_out(Xs, Y, Ls, Bs)) → split_out(.(X, Xs), Y, Ls, .(X, Bs))
U1(H, L, S, split_out(L, H, A, B)) → U2(H, L, S, B, qsort_in(A, A1))
qsort_in([], []) → qsort_out([], [])
U2(H, L, S, B, qsort_out(A, A1)) → U3(H, L, S, A1, qsort_in(B, B1))
U3(H, L, S, A1, qsort_out(B, B1)) → U4(H, L, S, append_in(A1, .(H, B1), S))
append_in(.(H, L1), L2, .(H, L3)) → U9(H, L1, L2, L3, append_in(L1, L2, L3))
append_in([], L, L) → append_out([], L, L)
U9(H, L1, L2, L3, append_out(L1, L2, L3)) → append_out(.(H, L1), L2, .(H, L3))
U4(H, L, S, append_out(A1, .(H, B1), S)) → qsort_out(.(H, L), S)

The argument filtering Pi contains the following mapping:
qsort_in(x1, x2)  =  qsort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4)  =  U1(x1, x4)
split_in(x1, x2, x3, x4)  =  split_in(x1, x2)
U7(x1, x2, x3, x4, x5, x6)  =  U7(x1, x2, x3, x6)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U10(x1, x2, x3)  =  U10(x3)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x6)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x1, x2, x3, x6)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U11(x1, x2, x3)  =  U11(x3)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x6)
[]  =  []
split_out(x1, x2, x3, x4)  =  split_out(x3, x4)
U2(x1, x2, x3, x4, x5)  =  U2(x1, x4, x5)
qsort_out(x1, x2)  =  qsort_out(x2)
U3(x1, x2, x3, x4, x5)  =  U3(x1, x4, x5)
U4(x1, x2, x3, x4)  =  U4(x4)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U9(x1, x2, x3, x4, x5)  =  U9(x1, x5)
append_out(x1, x2, x3)  =  append_out(x3)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

qsort_in(.(H, L), S) → U1(H, L, S, split_in(L, H, A, B))
split_in(.(X, Xs), Y, Ls, .(X, Bs)) → U7(X, Xs, Y, Ls, Bs, gt_in(X, Y))
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U10(X, Y, gt_in(X, Y))
U10(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U7(X, Xs, Y, Ls, Bs, gt_out(X, Y)) → U8(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
split_in(.(X, Xs), Y, .(X, Ls), Bs) → U5(X, Xs, Y, Ls, Bs, le_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U11(X, Y, le_in(X, Y))
U11(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))
U5(X, Xs, Y, Ls, Bs, le_out(X, Y)) → U6(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
split_in([], Y, [], []) → split_out([], Y, [], [])
U6(X, Xs, Y, Ls, Bs, split_out(Xs, Y, Ls, Bs)) → split_out(.(X, Xs), Y, .(X, Ls), Bs)
U8(X, Xs, Y, Ls, Bs, split_out(Xs, Y, Ls, Bs)) → split_out(.(X, Xs), Y, Ls, .(X, Bs))
U1(H, L, S, split_out(L, H, A, B)) → U2(H, L, S, B, qsort_in(A, A1))
qsort_in([], []) → qsort_out([], [])
U2(H, L, S, B, qsort_out(A, A1)) → U3(H, L, S, A1, qsort_in(B, B1))
U3(H, L, S, A1, qsort_out(B, B1)) → U4(H, L, S, append_in(A1, .(H, B1), S))
append_in(.(H, L1), L2, .(H, L3)) → U9(H, L1, L2, L3, append_in(L1, L2, L3))
append_in([], L, L) → append_out([], L, L)
U9(H, L1, L2, L3, append_out(L1, L2, L3)) → append_out(.(H, L1), L2, .(H, L3))
U4(H, L, S, append_out(A1, .(H, B1), S)) → qsort_out(.(H, L), S)

The argument filtering Pi contains the following mapping:
qsort_in(x1, x2)  =  qsort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4)  =  U1(x1, x4)
split_in(x1, x2, x3, x4)  =  split_in(x1, x2)
U7(x1, x2, x3, x4, x5, x6)  =  U7(x1, x2, x3, x6)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U10(x1, x2, x3)  =  U10(x3)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x6)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x1, x2, x3, x6)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U11(x1, x2, x3)  =  U11(x3)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x6)
[]  =  []
split_out(x1, x2, x3, x4)  =  split_out(x3, x4)
U2(x1, x2, x3, x4, x5)  =  U2(x1, x4, x5)
qsort_out(x1, x2)  =  qsort_out(x2)
U3(x1, x2, x3, x4, x5)  =  U3(x1, x4, x5)
U4(x1, x2, x3, x4)  =  U4(x4)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U9(x1, x2, x3, x4, x5)  =  U9(x1, x5)
append_out(x1, x2, x3)  =  append_out(x3)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

QSORT_IN(.(H, L), S) → U11(H, L, S, split_in(L, H, A, B))
QSORT_IN(.(H, L), S) → SPLIT_IN(L, H, A, B)
SPLIT_IN(.(X, Xs), Y, Ls, .(X, Bs)) → U71(X, Xs, Y, Ls, Bs, gt_in(X, Y))
SPLIT_IN(.(X, Xs), Y, Ls, .(X, Bs)) → GT_IN(X, Y)
GT_IN(s(X), s(Y)) → U101(X, Y, gt_in(X, Y))
GT_IN(s(X), s(Y)) → GT_IN(X, Y)
U71(X, Xs, Y, Ls, Bs, gt_out(X, Y)) → U81(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
U71(X, Xs, Y, Ls, Bs, gt_out(X, Y)) → SPLIT_IN(Xs, Y, Ls, Bs)
SPLIT_IN(.(X, Xs), Y, .(X, Ls), Bs) → U51(X, Xs, Y, Ls, Bs, le_in(X, Y))
SPLIT_IN(.(X, Xs), Y, .(X, Ls), Bs) → LE_IN(X, Y)
LE_IN(s(X), s(Y)) → U111(X, Y, le_in(X, Y))
LE_IN(s(X), s(Y)) → LE_IN(X, Y)
U51(X, Xs, Y, Ls, Bs, le_out(X, Y)) → U61(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
U51(X, Xs, Y, Ls, Bs, le_out(X, Y)) → SPLIT_IN(Xs, Y, Ls, Bs)
U11(H, L, S, split_out(L, H, A, B)) → U21(H, L, S, B, qsort_in(A, A1))
U11(H, L, S, split_out(L, H, A, B)) → QSORT_IN(A, A1)
U21(H, L, S, B, qsort_out(A, A1)) → U31(H, L, S, A1, qsort_in(B, B1))
U21(H, L, S, B, qsort_out(A, A1)) → QSORT_IN(B, B1)
U31(H, L, S, A1, qsort_out(B, B1)) → U41(H, L, S, append_in(A1, .(H, B1), S))
U31(H, L, S, A1, qsort_out(B, B1)) → APPEND_IN(A1, .(H, B1), S)
APPEND_IN(.(H, L1), L2, .(H, L3)) → U91(H, L1, L2, L3, append_in(L1, L2, L3))
APPEND_IN(.(H, L1), L2, .(H, L3)) → APPEND_IN(L1, L2, L3)

The TRS R consists of the following rules:

qsort_in(.(H, L), S) → U1(H, L, S, split_in(L, H, A, B))
split_in(.(X, Xs), Y, Ls, .(X, Bs)) → U7(X, Xs, Y, Ls, Bs, gt_in(X, Y))
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U10(X, Y, gt_in(X, Y))
U10(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U7(X, Xs, Y, Ls, Bs, gt_out(X, Y)) → U8(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
split_in(.(X, Xs), Y, .(X, Ls), Bs) → U5(X, Xs, Y, Ls, Bs, le_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U11(X, Y, le_in(X, Y))
U11(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))
U5(X, Xs, Y, Ls, Bs, le_out(X, Y)) → U6(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
split_in([], Y, [], []) → split_out([], Y, [], [])
U6(X, Xs, Y, Ls, Bs, split_out(Xs, Y, Ls, Bs)) → split_out(.(X, Xs), Y, .(X, Ls), Bs)
U8(X, Xs, Y, Ls, Bs, split_out(Xs, Y, Ls, Bs)) → split_out(.(X, Xs), Y, Ls, .(X, Bs))
U1(H, L, S, split_out(L, H, A, B)) → U2(H, L, S, B, qsort_in(A, A1))
qsort_in([], []) → qsort_out([], [])
U2(H, L, S, B, qsort_out(A, A1)) → U3(H, L, S, A1, qsort_in(B, B1))
U3(H, L, S, A1, qsort_out(B, B1)) → U4(H, L, S, append_in(A1, .(H, B1), S))
append_in(.(H, L1), L2, .(H, L3)) → U9(H, L1, L2, L3, append_in(L1, L2, L3))
append_in([], L, L) → append_out([], L, L)
U9(H, L1, L2, L3, append_out(L1, L2, L3)) → append_out(.(H, L1), L2, .(H, L3))
U4(H, L, S, append_out(A1, .(H, B1), S)) → qsort_out(.(H, L), S)

The argument filtering Pi contains the following mapping:
qsort_in(x1, x2)  =  qsort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4)  =  U1(x1, x4)
split_in(x1, x2, x3, x4)  =  split_in(x1, x2)
U7(x1, x2, x3, x4, x5, x6)  =  U7(x1, x2, x3, x6)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U10(x1, x2, x3)  =  U10(x3)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x6)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x1, x2, x3, x6)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U11(x1, x2, x3)  =  U11(x3)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x6)
[]  =  []
split_out(x1, x2, x3, x4)  =  split_out(x3, x4)
U2(x1, x2, x3, x4, x5)  =  U2(x1, x4, x5)
qsort_out(x1, x2)  =  qsort_out(x2)
U3(x1, x2, x3, x4, x5)  =  U3(x1, x4, x5)
U4(x1, x2, x3, x4)  =  U4(x4)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U9(x1, x2, x3, x4, x5)  =  U9(x1, x5)
append_out(x1, x2, x3)  =  append_out(x3)
U111(x1, x2, x3)  =  U111(x3)
U51(x1, x2, x3, x4, x5, x6)  =  U51(x1, x2, x3, x6)
U41(x1, x2, x3, x4)  =  U41(x4)
APPEND_IN(x1, x2, x3)  =  APPEND_IN(x1, x2)
U31(x1, x2, x3, x4, x5)  =  U31(x1, x4, x5)
U91(x1, x2, x3, x4, x5)  =  U91(x1, x5)
U81(x1, x2, x3, x4, x5, x6)  =  U81(x1, x6)
LE_IN(x1, x2)  =  LE_IN(x1, x2)
U71(x1, x2, x3, x4, x5, x6)  =  U71(x1, x2, x3, x6)
SPLIT_IN(x1, x2, x3, x4)  =  SPLIT_IN(x1, x2)
U101(x1, x2, x3)  =  U101(x3)
U21(x1, x2, x3, x4, x5)  =  U21(x1, x4, x5)
QSORT_IN(x1, x2)  =  QSORT_IN(x1)
GT_IN(x1, x2)  =  GT_IN(x1, x2)
U11(x1, x2, x3, x4)  =  U11(x1, x4)
U61(x1, x2, x3, x4, x5, x6)  =  U61(x1, x6)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

QSORT_IN(.(H, L), S) → U11(H, L, S, split_in(L, H, A, B))
QSORT_IN(.(H, L), S) → SPLIT_IN(L, H, A, B)
SPLIT_IN(.(X, Xs), Y, Ls, .(X, Bs)) → U71(X, Xs, Y, Ls, Bs, gt_in(X, Y))
SPLIT_IN(.(X, Xs), Y, Ls, .(X, Bs)) → GT_IN(X, Y)
GT_IN(s(X), s(Y)) → U101(X, Y, gt_in(X, Y))
GT_IN(s(X), s(Y)) → GT_IN(X, Y)
U71(X, Xs, Y, Ls, Bs, gt_out(X, Y)) → U81(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
U71(X, Xs, Y, Ls, Bs, gt_out(X, Y)) → SPLIT_IN(Xs, Y, Ls, Bs)
SPLIT_IN(.(X, Xs), Y, .(X, Ls), Bs) → U51(X, Xs, Y, Ls, Bs, le_in(X, Y))
SPLIT_IN(.(X, Xs), Y, .(X, Ls), Bs) → LE_IN(X, Y)
LE_IN(s(X), s(Y)) → U111(X, Y, le_in(X, Y))
LE_IN(s(X), s(Y)) → LE_IN(X, Y)
U51(X, Xs, Y, Ls, Bs, le_out(X, Y)) → U61(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
U51(X, Xs, Y, Ls, Bs, le_out(X, Y)) → SPLIT_IN(Xs, Y, Ls, Bs)
U11(H, L, S, split_out(L, H, A, B)) → U21(H, L, S, B, qsort_in(A, A1))
U11(H, L, S, split_out(L, H, A, B)) → QSORT_IN(A, A1)
U21(H, L, S, B, qsort_out(A, A1)) → U31(H, L, S, A1, qsort_in(B, B1))
U21(H, L, S, B, qsort_out(A, A1)) → QSORT_IN(B, B1)
U31(H, L, S, A1, qsort_out(B, B1)) → U41(H, L, S, append_in(A1, .(H, B1), S))
U31(H, L, S, A1, qsort_out(B, B1)) → APPEND_IN(A1, .(H, B1), S)
APPEND_IN(.(H, L1), L2, .(H, L3)) → U91(H, L1, L2, L3, append_in(L1, L2, L3))
APPEND_IN(.(H, L1), L2, .(H, L3)) → APPEND_IN(L1, L2, L3)

The TRS R consists of the following rules:

qsort_in(.(H, L), S) → U1(H, L, S, split_in(L, H, A, B))
split_in(.(X, Xs), Y, Ls, .(X, Bs)) → U7(X, Xs, Y, Ls, Bs, gt_in(X, Y))
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U10(X, Y, gt_in(X, Y))
U10(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U7(X, Xs, Y, Ls, Bs, gt_out(X, Y)) → U8(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
split_in(.(X, Xs), Y, .(X, Ls), Bs) → U5(X, Xs, Y, Ls, Bs, le_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U11(X, Y, le_in(X, Y))
U11(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))
U5(X, Xs, Y, Ls, Bs, le_out(X, Y)) → U6(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
split_in([], Y, [], []) → split_out([], Y, [], [])
U6(X, Xs, Y, Ls, Bs, split_out(Xs, Y, Ls, Bs)) → split_out(.(X, Xs), Y, .(X, Ls), Bs)
U8(X, Xs, Y, Ls, Bs, split_out(Xs, Y, Ls, Bs)) → split_out(.(X, Xs), Y, Ls, .(X, Bs))
U1(H, L, S, split_out(L, H, A, B)) → U2(H, L, S, B, qsort_in(A, A1))
qsort_in([], []) → qsort_out([], [])
U2(H, L, S, B, qsort_out(A, A1)) → U3(H, L, S, A1, qsort_in(B, B1))
U3(H, L, S, A1, qsort_out(B, B1)) → U4(H, L, S, append_in(A1, .(H, B1), S))
append_in(.(H, L1), L2, .(H, L3)) → U9(H, L1, L2, L3, append_in(L1, L2, L3))
append_in([], L, L) → append_out([], L, L)
U9(H, L1, L2, L3, append_out(L1, L2, L3)) → append_out(.(H, L1), L2, .(H, L3))
U4(H, L, S, append_out(A1, .(H, B1), S)) → qsort_out(.(H, L), S)

The argument filtering Pi contains the following mapping:
qsort_in(x1, x2)  =  qsort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4)  =  U1(x1, x4)
split_in(x1, x2, x3, x4)  =  split_in(x1, x2)
U7(x1, x2, x3, x4, x5, x6)  =  U7(x1, x2, x3, x6)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U10(x1, x2, x3)  =  U10(x3)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x6)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x1, x2, x3, x6)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U11(x1, x2, x3)  =  U11(x3)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x6)
[]  =  []
split_out(x1, x2, x3, x4)  =  split_out(x3, x4)
U2(x1, x2, x3, x4, x5)  =  U2(x1, x4, x5)
qsort_out(x1, x2)  =  qsort_out(x2)
U3(x1, x2, x3, x4, x5)  =  U3(x1, x4, x5)
U4(x1, x2, x3, x4)  =  U4(x4)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U9(x1, x2, x3, x4, x5)  =  U9(x1, x5)
append_out(x1, x2, x3)  =  append_out(x3)
U111(x1, x2, x3)  =  U111(x3)
U51(x1, x2, x3, x4, x5, x6)  =  U51(x1, x2, x3, x6)
U41(x1, x2, x3, x4)  =  U41(x4)
APPEND_IN(x1, x2, x3)  =  APPEND_IN(x1, x2)
U31(x1, x2, x3, x4, x5)  =  U31(x1, x4, x5)
U91(x1, x2, x3, x4, x5)  =  U91(x1, x5)
U81(x1, x2, x3, x4, x5, x6)  =  U81(x1, x6)
LE_IN(x1, x2)  =  LE_IN(x1, x2)
U71(x1, x2, x3, x4, x5, x6)  =  U71(x1, x2, x3, x6)
SPLIT_IN(x1, x2, x3, x4)  =  SPLIT_IN(x1, x2)
U101(x1, x2, x3)  =  U101(x3)
U21(x1, x2, x3, x4, x5)  =  U21(x1, x4, x5)
QSORT_IN(x1, x2)  =  QSORT_IN(x1)
GT_IN(x1, x2)  =  GT_IN(x1, x2)
U11(x1, x2, x3, x4)  =  U11(x1, x4)
U61(x1, x2, x3, x4, x5, x6)  =  U61(x1, x6)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 5 SCCs with 11 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APPEND_IN(.(H, L1), L2, .(H, L3)) → APPEND_IN(L1, L2, L3)

The TRS R consists of the following rules:

qsort_in(.(H, L), S) → U1(H, L, S, split_in(L, H, A, B))
split_in(.(X, Xs), Y, Ls, .(X, Bs)) → U7(X, Xs, Y, Ls, Bs, gt_in(X, Y))
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U10(X, Y, gt_in(X, Y))
U10(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U7(X, Xs, Y, Ls, Bs, gt_out(X, Y)) → U8(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
split_in(.(X, Xs), Y, .(X, Ls), Bs) → U5(X, Xs, Y, Ls, Bs, le_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U11(X, Y, le_in(X, Y))
U11(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))
U5(X, Xs, Y, Ls, Bs, le_out(X, Y)) → U6(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
split_in([], Y, [], []) → split_out([], Y, [], [])
U6(X, Xs, Y, Ls, Bs, split_out(Xs, Y, Ls, Bs)) → split_out(.(X, Xs), Y, .(X, Ls), Bs)
U8(X, Xs, Y, Ls, Bs, split_out(Xs, Y, Ls, Bs)) → split_out(.(X, Xs), Y, Ls, .(X, Bs))
U1(H, L, S, split_out(L, H, A, B)) → U2(H, L, S, B, qsort_in(A, A1))
qsort_in([], []) → qsort_out([], [])
U2(H, L, S, B, qsort_out(A, A1)) → U3(H, L, S, A1, qsort_in(B, B1))
U3(H, L, S, A1, qsort_out(B, B1)) → U4(H, L, S, append_in(A1, .(H, B1), S))
append_in(.(H, L1), L2, .(H, L3)) → U9(H, L1, L2, L3, append_in(L1, L2, L3))
append_in([], L, L) → append_out([], L, L)
U9(H, L1, L2, L3, append_out(L1, L2, L3)) → append_out(.(H, L1), L2, .(H, L3))
U4(H, L, S, append_out(A1, .(H, B1), S)) → qsort_out(.(H, L), S)

The argument filtering Pi contains the following mapping:
qsort_in(x1, x2)  =  qsort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4)  =  U1(x1, x4)
split_in(x1, x2, x3, x4)  =  split_in(x1, x2)
U7(x1, x2, x3, x4, x5, x6)  =  U7(x1, x2, x3, x6)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U10(x1, x2, x3)  =  U10(x3)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x6)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x1, x2, x3, x6)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U11(x1, x2, x3)  =  U11(x3)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x6)
[]  =  []
split_out(x1, x2, x3, x4)  =  split_out(x3, x4)
U2(x1, x2, x3, x4, x5)  =  U2(x1, x4, x5)
qsort_out(x1, x2)  =  qsort_out(x2)
U3(x1, x2, x3, x4, x5)  =  U3(x1, x4, x5)
U4(x1, x2, x3, x4)  =  U4(x4)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U9(x1, x2, x3, x4, x5)  =  U9(x1, x5)
append_out(x1, x2, x3)  =  append_out(x3)
APPEND_IN(x1, x2, x3)  =  APPEND_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APPEND_IN(.(H, L1), L2, .(H, L3)) → APPEND_IN(L1, L2, L3)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
APPEND_IN(x1, x2, x3)  =  APPEND_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

APPEND_IN(.(H, L1), L2) → APPEND_IN(L1, L2)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LE_IN(s(X), s(Y)) → LE_IN(X, Y)

The TRS R consists of the following rules:

qsort_in(.(H, L), S) → U1(H, L, S, split_in(L, H, A, B))
split_in(.(X, Xs), Y, Ls, .(X, Bs)) → U7(X, Xs, Y, Ls, Bs, gt_in(X, Y))
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U10(X, Y, gt_in(X, Y))
U10(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U7(X, Xs, Y, Ls, Bs, gt_out(X, Y)) → U8(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
split_in(.(X, Xs), Y, .(X, Ls), Bs) → U5(X, Xs, Y, Ls, Bs, le_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U11(X, Y, le_in(X, Y))
U11(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))
U5(X, Xs, Y, Ls, Bs, le_out(X, Y)) → U6(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
split_in([], Y, [], []) → split_out([], Y, [], [])
U6(X, Xs, Y, Ls, Bs, split_out(Xs, Y, Ls, Bs)) → split_out(.(X, Xs), Y, .(X, Ls), Bs)
U8(X, Xs, Y, Ls, Bs, split_out(Xs, Y, Ls, Bs)) → split_out(.(X, Xs), Y, Ls, .(X, Bs))
U1(H, L, S, split_out(L, H, A, B)) → U2(H, L, S, B, qsort_in(A, A1))
qsort_in([], []) → qsort_out([], [])
U2(H, L, S, B, qsort_out(A, A1)) → U3(H, L, S, A1, qsort_in(B, B1))
U3(H, L, S, A1, qsort_out(B, B1)) → U4(H, L, S, append_in(A1, .(H, B1), S))
append_in(.(H, L1), L2, .(H, L3)) → U9(H, L1, L2, L3, append_in(L1, L2, L3))
append_in([], L, L) → append_out([], L, L)
U9(H, L1, L2, L3, append_out(L1, L2, L3)) → append_out(.(H, L1), L2, .(H, L3))
U4(H, L, S, append_out(A1, .(H, B1), S)) → qsort_out(.(H, L), S)

The argument filtering Pi contains the following mapping:
qsort_in(x1, x2)  =  qsort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4)  =  U1(x1, x4)
split_in(x1, x2, x3, x4)  =  split_in(x1, x2)
U7(x1, x2, x3, x4, x5, x6)  =  U7(x1, x2, x3, x6)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U10(x1, x2, x3)  =  U10(x3)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x6)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x1, x2, x3, x6)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U11(x1, x2, x3)  =  U11(x3)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x6)
[]  =  []
split_out(x1, x2, x3, x4)  =  split_out(x3, x4)
U2(x1, x2, x3, x4, x5)  =  U2(x1, x4, x5)
qsort_out(x1, x2)  =  qsort_out(x2)
U3(x1, x2, x3, x4, x5)  =  U3(x1, x4, x5)
U4(x1, x2, x3, x4)  =  U4(x4)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U9(x1, x2, x3, x4, x5)  =  U9(x1, x5)
append_out(x1, x2, x3)  =  append_out(x3)
LE_IN(x1, x2)  =  LE_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LE_IN(s(X), s(Y)) → LE_IN(X, Y)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

LE_IN(s(X), s(Y)) → LE_IN(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

GT_IN(s(X), s(Y)) → GT_IN(X, Y)

The TRS R consists of the following rules:

qsort_in(.(H, L), S) → U1(H, L, S, split_in(L, H, A, B))
split_in(.(X, Xs), Y, Ls, .(X, Bs)) → U7(X, Xs, Y, Ls, Bs, gt_in(X, Y))
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U10(X, Y, gt_in(X, Y))
U10(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U7(X, Xs, Y, Ls, Bs, gt_out(X, Y)) → U8(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
split_in(.(X, Xs), Y, .(X, Ls), Bs) → U5(X, Xs, Y, Ls, Bs, le_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U11(X, Y, le_in(X, Y))
U11(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))
U5(X, Xs, Y, Ls, Bs, le_out(X, Y)) → U6(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
split_in([], Y, [], []) → split_out([], Y, [], [])
U6(X, Xs, Y, Ls, Bs, split_out(Xs, Y, Ls, Bs)) → split_out(.(X, Xs), Y, .(X, Ls), Bs)
U8(X, Xs, Y, Ls, Bs, split_out(Xs, Y, Ls, Bs)) → split_out(.(X, Xs), Y, Ls, .(X, Bs))
U1(H, L, S, split_out(L, H, A, B)) → U2(H, L, S, B, qsort_in(A, A1))
qsort_in([], []) → qsort_out([], [])
U2(H, L, S, B, qsort_out(A, A1)) → U3(H, L, S, A1, qsort_in(B, B1))
U3(H, L, S, A1, qsort_out(B, B1)) → U4(H, L, S, append_in(A1, .(H, B1), S))
append_in(.(H, L1), L2, .(H, L3)) → U9(H, L1, L2, L3, append_in(L1, L2, L3))
append_in([], L, L) → append_out([], L, L)
U9(H, L1, L2, L3, append_out(L1, L2, L3)) → append_out(.(H, L1), L2, .(H, L3))
U4(H, L, S, append_out(A1, .(H, B1), S)) → qsort_out(.(H, L), S)

The argument filtering Pi contains the following mapping:
qsort_in(x1, x2)  =  qsort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4)  =  U1(x1, x4)
split_in(x1, x2, x3, x4)  =  split_in(x1, x2)
U7(x1, x2, x3, x4, x5, x6)  =  U7(x1, x2, x3, x6)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U10(x1, x2, x3)  =  U10(x3)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x6)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x1, x2, x3, x6)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U11(x1, x2, x3)  =  U11(x3)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x6)
[]  =  []
split_out(x1, x2, x3, x4)  =  split_out(x3, x4)
U2(x1, x2, x3, x4, x5)  =  U2(x1, x4, x5)
qsort_out(x1, x2)  =  qsort_out(x2)
U3(x1, x2, x3, x4, x5)  =  U3(x1, x4, x5)
U4(x1, x2, x3, x4)  =  U4(x4)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U9(x1, x2, x3, x4, x5)  =  U9(x1, x5)
append_out(x1, x2, x3)  =  append_out(x3)
GT_IN(x1, x2)  =  GT_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

GT_IN(s(X), s(Y)) → GT_IN(X, Y)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

GT_IN(s(X), s(Y)) → GT_IN(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SPLIT_IN(.(X, Xs), Y, Ls, .(X, Bs)) → U71(X, Xs, Y, Ls, Bs, gt_in(X, Y))
U71(X, Xs, Y, Ls, Bs, gt_out(X, Y)) → SPLIT_IN(Xs, Y, Ls, Bs)
U51(X, Xs, Y, Ls, Bs, le_out(X, Y)) → SPLIT_IN(Xs, Y, Ls, Bs)
SPLIT_IN(.(X, Xs), Y, .(X, Ls), Bs) → U51(X, Xs, Y, Ls, Bs, le_in(X, Y))

The TRS R consists of the following rules:

qsort_in(.(H, L), S) → U1(H, L, S, split_in(L, H, A, B))
split_in(.(X, Xs), Y, Ls, .(X, Bs)) → U7(X, Xs, Y, Ls, Bs, gt_in(X, Y))
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U10(X, Y, gt_in(X, Y))
U10(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U7(X, Xs, Y, Ls, Bs, gt_out(X, Y)) → U8(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
split_in(.(X, Xs), Y, .(X, Ls), Bs) → U5(X, Xs, Y, Ls, Bs, le_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U11(X, Y, le_in(X, Y))
U11(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))
U5(X, Xs, Y, Ls, Bs, le_out(X, Y)) → U6(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
split_in([], Y, [], []) → split_out([], Y, [], [])
U6(X, Xs, Y, Ls, Bs, split_out(Xs, Y, Ls, Bs)) → split_out(.(X, Xs), Y, .(X, Ls), Bs)
U8(X, Xs, Y, Ls, Bs, split_out(Xs, Y, Ls, Bs)) → split_out(.(X, Xs), Y, Ls, .(X, Bs))
U1(H, L, S, split_out(L, H, A, B)) → U2(H, L, S, B, qsort_in(A, A1))
qsort_in([], []) → qsort_out([], [])
U2(H, L, S, B, qsort_out(A, A1)) → U3(H, L, S, A1, qsort_in(B, B1))
U3(H, L, S, A1, qsort_out(B, B1)) → U4(H, L, S, append_in(A1, .(H, B1), S))
append_in(.(H, L1), L2, .(H, L3)) → U9(H, L1, L2, L3, append_in(L1, L2, L3))
append_in([], L, L) → append_out([], L, L)
U9(H, L1, L2, L3, append_out(L1, L2, L3)) → append_out(.(H, L1), L2, .(H, L3))
U4(H, L, S, append_out(A1, .(H, B1), S)) → qsort_out(.(H, L), S)

The argument filtering Pi contains the following mapping:
qsort_in(x1, x2)  =  qsort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4)  =  U1(x1, x4)
split_in(x1, x2, x3, x4)  =  split_in(x1, x2)
U7(x1, x2, x3, x4, x5, x6)  =  U7(x1, x2, x3, x6)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U10(x1, x2, x3)  =  U10(x3)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x6)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x1, x2, x3, x6)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U11(x1, x2, x3)  =  U11(x3)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x6)
[]  =  []
split_out(x1, x2, x3, x4)  =  split_out(x3, x4)
U2(x1, x2, x3, x4, x5)  =  U2(x1, x4, x5)
qsort_out(x1, x2)  =  qsort_out(x2)
U3(x1, x2, x3, x4, x5)  =  U3(x1, x4, x5)
U4(x1, x2, x3, x4)  =  U4(x4)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U9(x1, x2, x3, x4, x5)  =  U9(x1, x5)
append_out(x1, x2, x3)  =  append_out(x3)
U51(x1, x2, x3, x4, x5, x6)  =  U51(x1, x2, x3, x6)
U71(x1, x2, x3, x4, x5, x6)  =  U71(x1, x2, x3, x6)
SPLIT_IN(x1, x2, x3, x4)  =  SPLIT_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SPLIT_IN(.(X, Xs), Y, Ls, .(X, Bs)) → U71(X, Xs, Y, Ls, Bs, gt_in(X, Y))
U71(X, Xs, Y, Ls, Bs, gt_out(X, Y)) → SPLIT_IN(Xs, Y, Ls, Bs)
U51(X, Xs, Y, Ls, Bs, le_out(X, Y)) → SPLIT_IN(Xs, Y, Ls, Bs)
SPLIT_IN(.(X, Xs), Y, .(X, Ls), Bs) → U51(X, Xs, Y, Ls, Bs, le_in(X, Y))

The TRS R consists of the following rules:

gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U10(X, Y, gt_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U11(X, Y, le_in(X, Y))
U10(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U11(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U10(x1, x2, x3)  =  U10(x3)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U11(x1, x2, x3)  =  U11(x3)
U51(x1, x2, x3, x4, x5, x6)  =  U51(x1, x2, x3, x6)
U71(x1, x2, x3, x4, x5, x6)  =  U71(x1, x2, x3, x6)
SPLIT_IN(x1, x2, x3, x4)  =  SPLIT_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

U51(X, Xs, Y, le_out) → SPLIT_IN(Xs, Y)
U71(X, Xs, Y, gt_out) → SPLIT_IN(Xs, Y)
SPLIT_IN(.(X, Xs), Y) → U71(X, Xs, Y, gt_in(X, Y))
SPLIT_IN(.(X, Xs), Y) → U51(X, Xs, Y, le_in(X, Y))

The TRS R consists of the following rules:

gt_in(s(X), 0) → gt_out
gt_in(s(X), s(Y)) → U10(gt_in(X, Y))
le_in(0, 0) → le_out
le_in(0, s(Y)) → le_out
le_in(s(X), s(Y)) → U11(le_in(X, Y))
U10(gt_out) → gt_out
U11(le_out) → le_out

The set Q consists of the following terms:

gt_in(x0, x1)
le_in(x0, x1)
U10(x0)
U11(x0)

We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

U11(H, L, S, split_out(L, H, A, B)) → QSORT_IN(A, A1)
U21(H, L, S, B, qsort_out(A, A1)) → QSORT_IN(B, B1)
QSORT_IN(.(H, L), S) → U11(H, L, S, split_in(L, H, A, B))
U11(H, L, S, split_out(L, H, A, B)) → U21(H, L, S, B, qsort_in(A, A1))

The TRS R consists of the following rules:

qsort_in(.(H, L), S) → U1(H, L, S, split_in(L, H, A, B))
split_in(.(X, Xs), Y, Ls, .(X, Bs)) → U7(X, Xs, Y, Ls, Bs, gt_in(X, Y))
gt_in(s(X), 0) → gt_out(s(X), 0)
gt_in(s(X), s(Y)) → U10(X, Y, gt_in(X, Y))
U10(X, Y, gt_out(X, Y)) → gt_out(s(X), s(Y))
U7(X, Xs, Y, Ls, Bs, gt_out(X, Y)) → U8(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
split_in(.(X, Xs), Y, .(X, Ls), Bs) → U5(X, Xs, Y, Ls, Bs, le_in(X, Y))
le_in(0, 0) → le_out(0, 0)
le_in(0, s(Y)) → le_out(0, s(Y))
le_in(s(X), s(Y)) → U11(X, Y, le_in(X, Y))
U11(X, Y, le_out(X, Y)) → le_out(s(X), s(Y))
U5(X, Xs, Y, Ls, Bs, le_out(X, Y)) → U6(X, Xs, Y, Ls, Bs, split_in(Xs, Y, Ls, Bs))
split_in([], Y, [], []) → split_out([], Y, [], [])
U6(X, Xs, Y, Ls, Bs, split_out(Xs, Y, Ls, Bs)) → split_out(.(X, Xs), Y, .(X, Ls), Bs)
U8(X, Xs, Y, Ls, Bs, split_out(Xs, Y, Ls, Bs)) → split_out(.(X, Xs), Y, Ls, .(X, Bs))
U1(H, L, S, split_out(L, H, A, B)) → U2(H, L, S, B, qsort_in(A, A1))
qsort_in([], []) → qsort_out([], [])
U2(H, L, S, B, qsort_out(A, A1)) → U3(H, L, S, A1, qsort_in(B, B1))
U3(H, L, S, A1, qsort_out(B, B1)) → U4(H, L, S, append_in(A1, .(H, B1), S))
append_in(.(H, L1), L2, .(H, L3)) → U9(H, L1, L2, L3, append_in(L1, L2, L3))
append_in([], L, L) → append_out([], L, L)
U9(H, L1, L2, L3, append_out(L1, L2, L3)) → append_out(.(H, L1), L2, .(H, L3))
U4(H, L, S, append_out(A1, .(H, B1), S)) → qsort_out(.(H, L), S)

The argument filtering Pi contains the following mapping:
qsort_in(x1, x2)  =  qsort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4)  =  U1(x1, x4)
split_in(x1, x2, x3, x4)  =  split_in(x1, x2)
U7(x1, x2, x3, x4, x5, x6)  =  U7(x1, x2, x3, x6)
gt_in(x1, x2)  =  gt_in(x1, x2)
s(x1)  =  s(x1)
0  =  0
gt_out(x1, x2)  =  gt_out
U10(x1, x2, x3)  =  U10(x3)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x6)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x1, x2, x3, x6)
le_in(x1, x2)  =  le_in(x1, x2)
le_out(x1, x2)  =  le_out
U11(x1, x2, x3)  =  U11(x3)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x6)
[]  =  []
split_out(x1, x2, x3, x4)  =  split_out(x3, x4)
U2(x1, x2, x3, x4, x5)  =  U2(x1, x4, x5)
qsort_out(x1, x2)  =  qsort_out(x2)
U3(x1, x2, x3, x4, x5)  =  U3(x1, x4, x5)
U4(x1, x2, x3, x4)  =  U4(x4)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U9(x1, x2, x3, x4, x5)  =  U9(x1, x5)
append_out(x1, x2, x3)  =  append_out(x3)
U21(x1, x2, x3, x4, x5)  =  U21(x1, x4, x5)
QSORT_IN(x1, x2)  =  QSORT_IN(x1)
U11(x1, x2, x3, x4)  =  U11(x1, x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
QDP
                    ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

U21(H, B, qsort_out(A1)) → QSORT_IN(B)
QSORT_IN(.(H, L)) → U11(H, split_in(L, H))
U11(H, split_out(A, B)) → QSORT_IN(A)
U11(H, split_out(A, B)) → U21(H, B, qsort_in(A))

The TRS R consists of the following rules:

qsort_in(.(H, L)) → U1(H, split_in(L, H))
split_in(.(X, Xs), Y) → U7(X, Xs, Y, gt_in(X, Y))
gt_in(s(X), 0) → gt_out
gt_in(s(X), s(Y)) → U10(gt_in(X, Y))
U10(gt_out) → gt_out
U7(X, Xs, Y, gt_out) → U8(X, split_in(Xs, Y))
split_in(.(X, Xs), Y) → U5(X, Xs, Y, le_in(X, Y))
le_in(0, 0) → le_out
le_in(0, s(Y)) → le_out
le_in(s(X), s(Y)) → U11(le_in(X, Y))
U11(le_out) → le_out
U5(X, Xs, Y, le_out) → U6(X, split_in(Xs, Y))
split_in([], Y) → split_out([], [])
U6(X, split_out(Ls, Bs)) → split_out(.(X, Ls), Bs)
U8(X, split_out(Ls, Bs)) → split_out(Ls, .(X, Bs))
U1(H, split_out(A, B)) → U2(H, B, qsort_in(A))
qsort_in([]) → qsort_out([])
U2(H, B, qsort_out(A1)) → U3(H, A1, qsort_in(B))
U3(H, A1, qsort_out(B1)) → U4(append_in(A1, .(H, B1)))
append_in(.(H, L1), L2) → U9(H, append_in(L1, L2))
append_in([], L) → append_out(L)
U9(H, append_out(L3)) → append_out(.(H, L3))
U4(append_out(S)) → qsort_out(S)

The set Q consists of the following terms:

qsort_in(x0)
split_in(x0, x1)
gt_in(x0, x1)
U10(x0)
U7(x0, x1, x2, x3)
le_in(x0, x1)
U11(x0)
U5(x0, x1, x2, x3)
U6(x0, x1)
U8(x0, x1)
U1(x0, x1)
U2(x0, x1, x2)
U3(x0, x1, x2)
append_in(x0, x1)
U9(x0, x1)
U4(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


QSORT_IN(.(H, L)) → U11(H, split_in(L, H))
The remaining pairs can at least be oriented weakly.

U21(H, B, qsort_out(A1)) → QSORT_IN(B)
U11(H, split_out(A, B)) → QSORT_IN(A)
U11(H, split_out(A, B)) → U21(H, B, qsort_in(A))
Used ordering: Polynomial interpretation [25]:

POL(.(x1, x2)) = 1 + x2   
POL(0) = 0   
POL(QSORT_IN(x1)) = 1 + x1   
POL(U1(x1, x2)) = 0   
POL(U10(x1)) = 0   
POL(U11(x1)) = 0   
POL(U11(x1, x2)) = 1 + x2   
POL(U2(x1, x2, x3)) = 0   
POL(U21(x1, x2, x3)) = 1 + x2   
POL(U3(x1, x2, x3)) = 0   
POL(U4(x1)) = 0   
POL(U5(x1, x2, x3, x4)) = 1 + x2   
POL(U6(x1, x2)) = 1 + x2   
POL(U7(x1, x2, x3, x4)) = 1 + x2   
POL(U8(x1, x2)) = 1 + x2   
POL(U9(x1, x2)) = 0   
POL([]) = 0   
POL(append_in(x1, x2)) = 0   
POL(append_out(x1)) = 0   
POL(gt_in(x1, x2)) = 0   
POL(gt_out) = 0   
POL(le_in(x1, x2)) = 0   
POL(le_out) = 0   
POL(qsort_in(x1)) = 0   
POL(qsort_out(x1)) = 0   
POL(s(x1)) = 0   
POL(split_in(x1, x2)) = x1   
POL(split_out(x1, x2)) = x1 + x2   

The following usable rules [17] were oriented:

U6(X, split_out(Ls, Bs)) → split_out(.(X, Ls), Bs)
split_in([], Y) → split_out([], [])
split_in(.(X, Xs), Y) → U7(X, Xs, Y, gt_in(X, Y))
U5(X, Xs, Y, le_out) → U6(X, split_in(Xs, Y))
U7(X, Xs, Y, gt_out) → U8(X, split_in(Xs, Y))
U8(X, split_out(Ls, Bs)) → split_out(Ls, .(X, Bs))
split_in(.(X, Xs), Y) → U5(X, Xs, Y, le_in(X, Y))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
QDP
                        ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

U21(H, B, qsort_out(A1)) → QSORT_IN(B)
U11(H, split_out(A, B)) → QSORT_IN(A)
U11(H, split_out(A, B)) → U21(H, B, qsort_in(A))

The TRS R consists of the following rules:

qsort_in(.(H, L)) → U1(H, split_in(L, H))
split_in(.(X, Xs), Y) → U7(X, Xs, Y, gt_in(X, Y))
gt_in(s(X), 0) → gt_out
gt_in(s(X), s(Y)) → U10(gt_in(X, Y))
U10(gt_out) → gt_out
U7(X, Xs, Y, gt_out) → U8(X, split_in(Xs, Y))
split_in(.(X, Xs), Y) → U5(X, Xs, Y, le_in(X, Y))
le_in(0, 0) → le_out
le_in(0, s(Y)) → le_out
le_in(s(X), s(Y)) → U11(le_in(X, Y))
U11(le_out) → le_out
U5(X, Xs, Y, le_out) → U6(X, split_in(Xs, Y))
split_in([], Y) → split_out([], [])
U6(X, split_out(Ls, Bs)) → split_out(.(X, Ls), Bs)
U8(X, split_out(Ls, Bs)) → split_out(Ls, .(X, Bs))
U1(H, split_out(A, B)) → U2(H, B, qsort_in(A))
qsort_in([]) → qsort_out([])
U2(H, B, qsort_out(A1)) → U3(H, A1, qsort_in(B))
U3(H, A1, qsort_out(B1)) → U4(append_in(A1, .(H, B1)))
append_in(.(H, L1), L2) → U9(H, append_in(L1, L2))
append_in([], L) → append_out(L)
U9(H, append_out(L3)) → append_out(.(H, L3))
U4(append_out(S)) → qsort_out(S)

The set Q consists of the following terms:

qsort_in(x0)
split_in(x0, x1)
gt_in(x0, x1)
U10(x0)
U7(x0, x1, x2, x3)
le_in(x0, x1)
U11(x0)
U5(x0, x1, x2, x3)
U6(x0, x1)
U8(x0, x1)
U1(x0, x1)
U2(x0, x1, x2)
U3(x0, x1, x2)
append_in(x0, x1)
U9(x0, x1)
U4(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 3 less nodes.